#include"processbar.h"
#include<unistd.h>

void Processbar(double length,double split)
{
    double current=0.0;
    while(current<=length)
    {
        FlushProcess(length,current);
        if(current>=length) break;
        usleep(5000);
        current+=split;
    }
}


int main()
{
    printf("下载中：\n");
    Processbar(1024.0,1.0);
    printf("下载中：\n");
    Processbar(512.0,1.0);
    printf("下载中：\n");
    Processbar(512.0,2.0);
    return 0;
}
